package com.example.business.controller;

import com.example.business.response.ProductSkuResponse;
import com.example.business.service.ProductSkuService;
import com.example.common.response.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/product")
public class ProductSkuController {
    @Autowired
    private ProductSkuService productSkuService;

    @GetMapping("/{productId}/skus")
    public R<List<ProductSkuResponse>> listByProductId(@PathVariable Long productId) {
        List<ProductSkuResponse> skuList = productSkuService.listByProductId(productId);
        return R.ok(skuList);
    }
} 